import Component from "../../../component";
import { setDataSourceConfig } from "../../../../utils/constant";

export class BorderBox1 extends Component {
  version = "0.0.1";
  config = {
    content: "dv-border-box-1",
    textStyle: {
      fontFamily: "Microsoft Yahei",
      fontSize: 24,
      color: "#fff",
      fontWeight: "normal",
      textAlign: "center",
      letterSpacing: 0,
      alignItems: "center",
      textIndent: 0
    },
    backgroundStyle: {
      show: false,
      bgColor: "#008bff",
    },
    urlConfig: {
      url: "",
      isBlank: false
    },
    global: {
      backgroundColor: "transparent",
      color: ["#4fd2dd", "#235fa7"]
    }
  };
  dataSource = null;
  events = null;
  actions = null;

  constructor(obj) {
    super("DvBorderBox1", { w: 300, h: 300 },);
    this.initData();
  }

  initData() {
    const fields = [
      { content: { description: "标题值", optional: true } },
      { url: { description: "超链接", optional: true } },
    ];
    const staticData = { content: "我是标题数据", url: "" };
    this.dataSource = setDataSourceConfig({}, this.id, staticData, {
      fields: Object.assign({}, ...fields),
    });
    this.events = {};
    this.actions = {};
    return this;
  }

  async loadData() {

  }
}
